
package com.example.moments.dao;

import androidx.room.Dao;
import androidx.room.Query;

import com.example.moments.ssmemo.entity.Comment;
import com.example.moments.ssmemo.entity.Link;

import java.util.List;

@Dao
public interface LinkDao extends BaseDao<Link> {

    @Query("DELETE FROM "+ Link.TABLE_NAME)
    void clearAll();
    
    @Query("SELECT * FROM " + Link.TABLE_NAME)
    List<Link> getAll();

    @Query("SELECT * FROM " + Link.TABLE_NAME + " where id = :id limit 1")
    Link getById(Long id);

    @Query("SELECT * FROM " + Link.TABLE_NAME + " WHERE id IN (:ids)")
    List<Link> loadAllByIds(Long[] ids);
}